"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
  data() {
    return {
      post: {
        title: "",
        content: ""
      }
    };
  },
  methods: {
    submitPost() {
      common_vendor.index.request({
        url: "http://localhost:3000/addPost",
        method: "POST",
        data: this.post,
        success: (res) => {
          common_vendor.index.switchTab({
            url: "../forum"
            // 替换为当前页面的实际路径
          });
        },
        fail: (err) => {
          console.error("提交失败:", err);
        }
      });
    }
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return {
    a: $data.post.title,
    b: common_vendor.o(($event) => $data.post.title = $event.detail.value),
    c: $data.post.content,
    d: common_vendor.o(($event) => $data.post.content = $event.detail.value),
    e: common_vendor.o((...args) => $options.submitPost && $options.submitPost(...args))
  };
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
